# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 11:00:06 2015

@author: liliangrong
"""


def break_words(stuff):
    """This function will break up words for us."""
    words = stuff.split(' ')
    return words
    
def sort_words(words):
    return sorted(words)
    
def first_word(words):
    word = words.pop(0)
    print word
    
    
def last_word(words):
    word = words.pop(-1)
    print word
    
def sort_sentence(sentence):
    words = break_words(sentence)
    return sort_words(words)
    
def first_and_last(sentence):
    words = break_words(sentence)
    first_word(words)
    last_word(words)
    
    
def first_and_last_sorted(sentence):
    words = sort_sentence(sentence)
    first_word(words)
    last_word(words)
    
